package com.mask.chapter02;

import java.util.Date;
import java.util.HashSet;

/**
 * @author hx
 * @since 2021/12/16 3:05 下午
 */

public class UserHashSetTest {
    public static void main(String[] args) {
        HashSet<User> hashSet = new HashSet<>();
        for (int i = 1; i < 10; i++) {
            User user = new User(i, "user" + i,
                    "pass" + i, i % 2 == 1 ? "男" : "女",
                    i % 2 == 0 ? "图书管理员" : "超级管理员", new Date());
            hashSet.add(user);
        }

        hashSet.forEach(user -> System.out.println("用户:"+ user));
    }
}
